package com.thread.threadfirst.google;

import com.google.common.base.Optional;

import java.util.HashMap;
import java.util.Map;

public class GoogleBaseTest {
    private static class Role{
        private Long Id;
        private String name;

        public Long getId() {
            return Id;
        }

        public void setId(Long id) {
            Id = id;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }
    }

    public static void main(String[] args) {
        Map<String,Object> map=new HashMap();
        map.put("key",null);
        Optional<Map<String, Object>> op = Optional.fromNullable(map);
        if (op.isPresent()) {
            System.out.println("get "+op.get());
        }else {
            System.out.println("not exist");
        }

    }
}
